//
//  KBMusicListHeaderView.m
//  喜马拉雅改良版框架
//
//  Created by dllo on 15/12/29.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "KBMusicListHeaderView.h"

@implementation KBMusicListHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews
{
    self.backgroundColor = [UIColor whiteColor];
    
    // 图片
    UIImageView *myImageView = [[UIImageView alloc] init];
    myImageView.image = [UIImage imageNamed:@"findsubject_cover@2x.png"];
    [self addSubview:myImageView];
    
    [myImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.mas_equalTo(20);
        make.left.mas_equalTo(10);
        make.width.mas_equalTo(40);
        make.height.mas_equalTo(40);
    }];
    // 标题
    _title = [[UILabel alloc] init];
    _title.font = [UIFont systemFontOfSize:20];
    [self addSubview:_title];
    
    [_title mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(myImageView.mas_top).offset(7);
        make.left.equalTo(myImageView.mas_right).offset(12);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(22);
        
    }];
    // 简介
    UILabel *intro = [[UILabel alloc] init];
    intro.text = @"---- 简介 ----";
    intro.font = [UIFont systemFontOfSize:14];
    intro.textColor = [UIColor colorWithRed:0.64 green:0.64 blue:0.64 alpha:1];
    intro.textAlignment = NSTextAlignmentCenter;
    [self addSubview:intro];
    [intro mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(_title).offset(45);
        make.left.right.mas_equalTo(0);
        make.height.mas_equalTo(20);
        
    }];
    // 简介内容
    _intro = [[UILabel alloc] initWithFrame:CGRectMake(10, 90, 355, 120)];
    _intro.font = [UIFont systemFontOfSize:14];
    _intro.textColor = [UIColor colorWithRed:0.64 green:0.64 blue:0.64 alpha:1];
    _intro.lineBreakMode = NSLineBreakByCharWrapping;
    _intro.textAlignment = NSTextAlignmentLeft;
    _intro.numberOfLines = 0;
    [self addSubview:_intro];
    
    // 小编姓名
    _nickname = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    _nickname.font = [UIFont systemFontOfSize:14];
    _nickname.textAlignment = NSTextAlignmentRight;
    _nickname.textColor = [UIColor colorWithRed:0.64 green:0.64 blue:0.64 alpha:1];
    [self addSubview:_nickname];
    
    //头像
    _smallLogo = [[UIImageView alloc] init];
    [self addSubview:_smallLogo];
    [_smallLogo mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.bottom.equalTo(_nickname.mas_bottom).offset(-2);
        make.right.mas_equalTo(_nickname.mas_left).offset(-5);
        make.width.mas_equalTo(20);
        make.height.mas_equalTo(20);
    }];
    
    // 小编:
    UILabel *minEdit = [[UILabel alloc] init];
    minEdit.text = @"小编: ";
    minEdit.font = [UIFont systemFontOfSize:14];
    minEdit.textColor = [UIColor colorWithRed:0.64 green:0.64 blue:0.64 alpha:1];
    minEdit.textAlignment = NSTextAlignmentRight;
    [self addSubview:minEdit];
    
    [minEdit mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.bottom.equalTo(_nickname.mas_bottom);
        make.right.mas_equalTo(_smallLogo.mas_left).offset(-10);
        make.width.mas_equalTo(40);
        make.height.mas_equalTo(22);
        
    }];
    
    
    
}




























/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
